﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenNI;

namespace Mapenect.GesturePatterns
{
    class MyJoint
    {
        private float _x;
        public float X
        {
            get { return _x; }
            set { _x = value; }
        }

        private float _y;
        public float Y
        {
            get { return _y; }
            set { _y = value; }
        }

        private float _z;
        public float Z
        {
            get { return _z; }
            set { _z = value; }
        }

        private float _dx;
        public float Dx
        {
            get { return _dx; }
            set { _dx = value; }
        }

        private float _dy;
        public float Dy
        {
            get { return _dy; }
            set { _dy = value; }
        }

        private float _dz;
        public float Dz
        {
            get { return _dz; }
            set { _dz = value; }
        }

        public MyJoint(SkeletonJointTransformation pos, MyJoint lastJoint)
        {
            X = pos.Position.Position.X;
            Y = pos.Position.Position.Y;
            Z = pos.Position.Position.Z;

            Dx = lastJoint.X - X;
            Dy = lastJoint.Y - Y;
            Dz = lastJoint.Z - Z;

        }

        public MyJoint(SkeletonJointTransformation pos)
        {
            X = pos.Position.Position.X;
            Y = pos.Position.Position.Y;
            Z = pos.Position.Position.Z;

            Dx = 0;
            Dy = 0;
            Dz = 0;
        }
    }
}
